package com.pktechan.api.service.impl;

import com.pktechan.api.base.BaseMapper;
import com.pktechan.api.base.BaseServiceImpl;
import com.pktechan.api.dao.CommissionBalanceMapper;
import com.pktechan.api.entity.CommissionBalance;
import com.pktechan.api.entity.CustBase;
import com.pktechan.api.service.CommissionBalanceService;
import com.pktechan.api.vo.SalesCenterVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("commissionBalanceService")
@Transactional
public class CommissionBalanceServiceImpl extends BaseServiceImpl<CommissionBalance> implements CommissionBalanceService {

    @Autowired
    private CommissionBalanceMapper commissionBalanceMapper;

    /**
     * 由业务类实现
     *
     * @return
     */
    @Override
    public BaseMapper<CommissionBalance> getBaseMapper() {
        return commissionBalanceMapper;
    }

    /**
     * 根据客户ID查询客户佣金持仓
     *
     * @param custId
     * @return
     */
    @Override
    public CommissionBalance getByCustId(Integer custId) {
        return commissionBalanceMapper.getByCustId(custId);
    }

    /**
     * 获取销售中心详情
     * @param custBase
     * @return
     */
    @Override
    public SalesCenterVO getSalesCenterDetail(CustBase custBase) {
        return commissionBalanceMapper.getSalesCenterDetail(custBase);
    }
}
